import Layout from '@/layout'

export default {
    path: '/permission',
    component: Layout,
    redirect: '/permission/page',
    alwaysShow: true, // 将始终显示根菜单
    name: 'Permission',
    meta: {
        title: '身份',
        icon: 'lock',
        roles: ['admin', 'editor'] // 可以在根导航中设置角色
    },
    children: [
        {
            path: 'page',
            component: () => import('@/views/permission/page'),
            name: 'PagePermission',
            meta: {
                title: 'Page Permission',
                roles: ['admin'] // or you can only set roles in sub nav
            }
        },
        {
            path: 'directive',
            component: () => import('@/views/permission/directive'),
            name: 'DirectivePermission',
            meta: {
                title: 'Directive Permission'
                // if do not set roles, means: this page does not require permission
            }
        },
        {
            path: 'role',
            component: () => import('@/views/permission/role'),
            name: 'RolePermission',
            meta: {
                title: 'Role Permission',
                roles: ['admin']
            }
        }
    ]
}
